home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / textfile / mac_faqs / gpp_faq / plain next >
Internet Message Format  |  1995-01-27  |  25KB

  1. Xref: bloom-picayune.mit.edu gnu.g++.help:2790 comp.lang.c++:34580 news.answers:4675
  2. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!news.media.mit.edu!micro-heart-of-gold.mit.edu!news.bbn.com!olivea!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!agate!usenet
  3. From: jbuck@ohm.berkeley.edu (Joe Buck)
  4. Newsgroups: gnu.g++.help,comp.lang.c++,news.answers
  5. Subject: FAQ for g++ and libg++, plain text version [Revised 16 Dec 1992]
  6. Message-ID: <1goh6uINN4mq@agate.berkeley.edu>
  7. Date: 17 Dec 92 00:21:50 GMT
  8. Expires: +1 month
  9. Followup-To: poster
  10. Organization: University of California, Berkeley
  11. Lines: 613
  12. Approved: news-answers-request@MIT.edu
  13. NNTP-Posting-Host: forney.berkeley.edu
  14.  
  15. Archive-name: g++-FAQ/plain
  16. Last-modified: 16 Dec 1992
  17. Frequency: bimonthly
  18.  
  19. [ this is the plain text version, the parent is the texinfo version ]
  20. Preface
  21. *******
  22.  
  23.    This is a list of frequently asked questions for g++ users; thanks
  24. to all those who sent suggestions for improvements.
  25.  
  26.    I'm looking for new questions, better answers, or both.  One thing
  27. that's missing is a section on templates and template problems with
  28. g++; I'm looking for contributions on this score.
  29.  
  30.    This FAQ is intended to supplement, not replace, Marshall Cline's
  31. excellent FAQ for comp.lang.c++.  Especially if g++ is the first C++
  32. compiler you've ever used, the question "How do I do <X> with g++?" is
  33. probably really "How do I do <X> in C++?".  You can obtain the C++ FAQ
  34. by anonymous FTP from sun.soe.clarkson.edu [128.153.12.3], in the file
  35. ~ftp/pub/C++/FAQ.  (There is also a mail server for that FAQ, but it
  36. seems to be broken).
  37.  
  38.  
  39. Obtaining Source Code
  40. *********************
  41.  
  42.  
  43. How do I get a copy of g++ for Unix?
  44. ====================================
  45.  
  46.    First, you may already have it if you have gcc for your platform;
  47. see the answer to question 3.
  48.  
  49.    If you're trying to find g++, you can get it by anonymous FTP, by
  50. anonymous UUCP, by buying a tape from the Free Software Foundation, or
  51. by getting it from a friend that has it.
  52.  
  53.    Here is a list of anonymous FTP archive sites for Gnu software.
  54.  
  55.      Japan: ftp.cs.titech.ac.jp, utsun.s.u-tokyo.ac.jp:ftpsync/prep
  56.      Australia: archie.au:gnu
  57.      Europe: src.doc.ic.ac.uk:gnu, ftp.informatik.tu-muenchen.de,
  58.          ftp.informatik.rwth-aachen.de:pub/gnu,
  59.          nic.funet.fi:pub/gnu, ugle.unit.no, isy.liu.se,
  60.          ftp.stacken.kth.se, sunic.sunet.se, ftp.win.tue.nl,
  61.          ftp.diku.dk, ftp.eunet.ch, archive.eu.net
  62.      United States: wuarchive.wustl.edu, ftp.cs.widener.edu,
  63.          uxc.cso.uiuc.edu, col.hp.com, gatekeeper.dec.com:pub/GNU,
  64.          ftp.uu.net:packages/gnu
  65.  
  66.    The "official site" is prep.ai.mit.edu, but your transfer will
  67. probably go faster if you use one of the above machines.
  68.  
  69.    Users of the HP Precision Architecture (HP-9000/7xx and
  70. HP-9000/8xx) may want to use the "2.3.1-u2" version available from the
  71. University of Utah, site jaguar.cs.utah.edu.  This version supports
  72. debugging provided that gas is used (you need the version of gas
  73. available from the same place) and has several bug fixes that weren't
  74. done in time for the 2.3.2 release.  Precompiled binaries of gcc and
  75. gdb can also be obtained from that site.  Hopefully this will all be
  76. folded in to 2.4.
  77.  
  78.    UUNET customers can get Gnu sources from UUNET via UUCP.  For
  79. information on how to order tapes from FSF, write to
  80. gnu@prep.ai.mit.edu.
  81.  
  82.    UUCP-only sites can get Gnu sources by "anonymous UUCP" from site
  83. "osu-cis" at Ohio State University.  You pay for the long-distance call
  84. to OSU; the price isn't too bad on weekends at 9600 bps.  Send mail to
  85. uucp@cis.ohio-state.edu or osu-cis!uucp for more information.
  86.  
  87.    OSU lines are often busy.  If you're in the USA, and are willing to
  88. spend more money, you can get sources via UUCP from UUNET using their
  89. 900 number: 1-900-GOT-SRCS (900 numbers don't work internationally). 
  90. You will be billed $0.50/minute by your phone company.
  91.  
  92.    Don't forget to retrieve libg++ as well!
  93.  
  94.  
  95. How do I get a copy of g++ for (some other platform)?
  96. =====================================================
  97.  
  98.    The standard gcc/g++ distribution includes VMS support.  Since the
  99. FSF people don't use VMS, it's likely to be somewhat less solid than
  100. the Unix version.  Precompiled copies of G++ and libg++ in
  101. VMS-installable form are available by FTP from mango.rsmas.miami.edu.
  102.  
  103.    DJ Delorie has ported gcc/g++ to MS-DOS; this port is popularly
  104. known as "DJGPP" (the P's stand for "plus").  It can be found on many
  105. FTP archive sites; its "home" is on grape.ecs.clarkson.edu, directory
  106. ~ftp/pub/msdos/djgpp.  Make sure you're retrieving the current version,
  107. which should indicate that it is a port of gcc-2.2.2 (2.3.1 and 2.3.2
  108. have been released since then, but I don't think the DOS port is done
  109. yet).  It is also available on site wuarchive.wustl.edu, in directory
  110. mirrors/msdos/djgpp, and many other places as well.
  111.  
  112.    For information on Amiga ports of gcc/g++, retrieve the file
  113. /pub/gnu/MicrosPorts/Amiga from prep.ai.mit.edu, or write to Leonard
  114. Norrgard <vinsci@nic.funet.fi>, who I hope won't be too upset that I
  115. mentioned his name here.
  116.  
  117.    A port of gcc-2.3.1 to the Atari ST can be found on the site
  118. "atari.archive.umich.edu", under /atari/Gnustuff/Tos, along with many
  119. other Gnu programs.  See the FAQ for the Usenet group
  120. "comp.sys.atari.st" for more information.
  121.  
  122.    There are two different ports of gcc-2.2.2 (and g++) to OS/2, the
  123. so-called EMX port, which requires a particular Unix emulator, and a
  124. port called "gcc/2", which runs native.  The latter port uses a rather
  125. buggy port of the BSD libc.  For more information ask around on
  126. comp.os.os2.programmer.  gcc/2 can be obtained by FTP from
  127.  
  128.      ftp-os2.nmsu.edu (128.123.35.151) in /pub/os2/2.0/programming/gcc2-222
  129.      luga.latrobe.edu.au (131.172.2.2) in /pub/os2/2.0/programming/gcc2-222
  130.  
  131.    Eberhard Mattes did the EMX port.  Tevor Lampre did the gcc/2 port. 
  132. Their addresses are mattes@azu.informatik.uni-stuttgart.de and
  133. mmtl@cc.flinders.edu.au, repectively.
  134.  
  135.    Because the legal policies of Apple threaten the long-term goals of
  136. FSF, as well as the concept of free software, no support will be lent
  137. to efforts to port Gnu software to Macintosh or other Apple hardware.
  138.  
  139.  
  140. But I can only find g++-1.42!
  141. =============================
  142.  
  143.    "I keep hearing people talking about g++ 2.3.2 (or some other number
  144. starting with 2), but the latest version I can find is g++ 1.42. 
  145. Where is it?"
  146.  
  147.    As of gcc 2.0, C, C++, and Objective-C as well are all combined
  148. into a single distribution called gcc.  If you get gcc you already
  149. have g++.  The standard installation procedure for any gcc version 2
  150. compiler will install the C++ compiler as well.
  151.  
  152.    One could argue that we shouldn't even refer to "g++-2.x.y" but
  153. it's a convention.  It means "the C++ compiler included with
  154. gcc-2.x.y".
  155.  
  156.  
  157. What is the latest version of gcc, g++, and libg++?
  158. ===================================================
  159.  
  160.    The latest "2.x" version of gcc/g++ is 2.3.2, released Nov 27, 1992. 
  161. The latest version of libg++ is 2.3, released Dec 9, 1992.
  162.  
  163.    For some non-Unix platforms, 2.2.2 may be the latest compiler that
  164. has been ported.  libg++ 2.3 will not compile with gcc-2.2.2.  Also,
  165. due to a newly introduced compiler bug, libg++ 2.2 will not compile
  166. with gcc-2.3.1 or gcc-2.3.2.
  167.  
  168.    The latest "1.x" version of gcc is 1.42, and the latest "1.x"
  169. version of g++ is 1.42.0.
  170.  
  171.  
  172. I have gcc-2.2.2 and libg++-2.2.  Should I upgrade to the new versions?
  173. =======================================================================
  174.  
  175.    Unfortunately, this question cannot be answered with a simple yes
  176. or no.  gcc-2.3.x made some significant improvements in template
  177. support; however, at the same time, quite a few new bugs were
  178. introduced in 2.3.1, particularly in resolving of overloaded
  179. functions.  2.3.2 fixed some of them, but serious problems remain (for
  180. example, 2.3.2 cannot compile some perfectly correct code in
  181. libg++-2.2).  Given this, I would recommend that those not using
  182. templates wait for a more stable release (gcc-2.3.3 should be out
  183. soon).  If you're using templates and 2.2.2 won't cut it for you, by
  184. all means upgrade.
  185.  
  186.  
  187. Installation Issues and Problems
  188. ********************************
  189.  
  190.  
  191. I can't build g++ 1.x.y with gcc-2.x.y!
  192. =======================================
  193.  
  194.    "I obtained gcc-2.x.y and g++ 1.x.y and I'm trying to build it, but
  195. I'm having major problems.  What's going on?"
  196.  
  197.    If you wish to build g++-1.42, you must obtain gcc-1.42 first.  The
  198. installation instructions for g++ version 1 leave a lot to be desired,
  199. unfortunately, and I would recommend that, unless you have a special
  200. reason for needing the 1.x compiler, that C++ users use g++-2.3.2, as
  201. it is the version that is being actively maintained.
  202.  
  203.    There is no template support in g++-1.x, and it is generally much
  204. further away from the ANSI draft standard than g++-2.x is.
  205.  
  206.  
  207. OK, I've obtained gcc; what else do I need?
  208. ===========================================
  209.  
  210.    First off, you'll want libg++ as you can do almost nothing without
  211. it (unless you replace it with some other class library).
  212.  
  213.    Second, depending on your platform, you may need "gas", the Gnu
  214. assembler, or the Gnu linker (see next question).
  215.  
  216.  
  217. Should I use the Gnu linker, or should I use "collect"?
  218. =======================================================
  219.  
  220.    First off, for novices: special measures must be taken with C++ to
  221. arrange for the calling of constructors for global or static objects
  222. before the execution of your program, and for the calling of
  223. destructors at the end.  (Exception: System VR3 and System VR4 linkers
  224. support user-defined segments; g++ on these systems requires neither
  225. the Gnu linker nor collect.  So if you have such a system, the answer
  226. is that you don't need either one).
  227.  
  228.    If you have experience with AT&T's "cfront", this function is
  229. performed there by programs named "patch" or "munch".  With Gnu C++,
  230. it is performed either by the Gnu linker or by a program known as
  231. "collect".  The collect program is part of the gcc-2.x distribution;
  232. you can obtain the Gnu linker separately as part of the "binutils"
  233. package.
  234.  
  235.    (To be technical, it's "collect2"; there were originally several
  236. alternative versions of collect, and this is the one that survived).
  237.  
  238.    There are advantages and disadvantages to either choice.
  239.  
  240.    Advantages of the Gnu linker:
  241.  
  242.    It's faster than using collect -- collect basically runs the
  243. standard Unix linker on your program twice, inserting some extra code
  244. after the first pass to call the constructors.  This is a sizable time
  245. penalty for large programs.  The Gnu linker does not require this
  246. extra pass.
  247.  
  248.    Gnu ld reports undefined symbols using their true names, not the
  249. mangled names.
  250.  
  251.    If there are undefined symbols, Gnu ld reports which object file(s)
  252. refer to the undefined symbol(s).
  253.  
  254.    Advantages of collect:
  255.  
  256.    If your native linker supports shared libraries, you can use shared
  257. libraries with collect.  The Gnu linker does not (yet) support shared
  258. libraries.
  259.  
  260.    The Gnu linker has not been ported to as many platforms as g++ has,
  261. so you may be forced to use collect.
  262.  
  263.    If you use collect, you don't need to get something extra and
  264. figure out how to install it; the standard gcc installation procedure
  265. will do it for you.
  266.  
  267.    In conclusion, I don't see a clear win for either alternative at
  268. this point.  Take your pick.
  269.  
  270.  
  271. Should I use the Gnu assembler, or my vendor's assembler?
  272. =========================================================
  273.  
  274.    This depends on your platform and your decision about the Gnu
  275. linker.  For most platforms, you'll need to use gas if you use the Gnu
  276. linker.  For some platforms, you have no choice; check the gcc
  277. installation notes to see whether you must use gas.  But you can
  278. usually use the vendor's assembler if you don't use the Gnu linker.
  279.  
  280.    The Gnu assembler assembles faster than many native assemblers;
  281. however, on many platforms it cannot support the local debugging
  282. format.
  283.  
  284.  
  285. Should I use the Gnu C library?
  286. ===============================
  287.  
  288.    At this point in time, no.  The Gnu C library is still very young,
  289. and libg++ still conflicts with it in some places.  Use your native C
  290. library unless you know a lot about the gory details of libg++ and
  291. gnu-libc.  This will probably change in the future.
  292.  
  293.  
  294. Problems building libg++ on Ultrix
  295. ==================================
  296.  
  297.    "I am having trouble building libg++-2.2 on Ultrix [and possibly
  298. other systems].  I get errors referring to "dummy.o".  Help!"
  299.  
  300.    (The errors on Ultrix end with something like
  301.  
  302.      ldopen: cannot open dummy.o
  303.      nm: Error: cannot open dummy.o
  304.      ldopen: cannot open dummy.o
  305.      nm: Error: cannot open dummy.o
  306.      nm failed to find FUNC in dummy.o!
  307.      sh: -1: bad number
  308.      *** Error code 1
  309.  
  310. and there may be similar problems on other systems).
  311.  
  312.    The fix for this is to make libg++ by saying "make CC=gcc".
  313.  
  314.  
  315. User Problems
  316. *************
  317.  
  318.  
  319. Linker reports undefined symbols for static data members
  320. ========================================================
  321.  
  322.    "g++ reports undefined symbols for all my static data members when
  323. I link, even though the program works correctly for compiler XYZ. 
  324. What's going on?"
  325.  
  326.    The problem is almost certainly that you don't give definitions for
  327. your static data members.  If you have
  328.  
  329.      class Foo {
  330.          ...
  331.          void method();
  332.          static int bar;
  333.      };
  334.  
  335.    you have only declared that there is an int named Foo::bar and a
  336. member function named Foo::method that is defined somewhere.  You
  337. still need to defined BOTH method() and bar in some source file. 
  338. According to the draft ANSI standard, you must supply an initializer,
  339. such as
  340.  
  341.      int Foo::bar = 0;
  342.  
  343. in one (and only one) source file.
  344.  
  345.  
  346. g++ won't accept the placement new syntax.
  347. ==========================================
  348.  
  349.    "I have a program that uses the "placement syntax" of operator new,
  350. e.g.
  351.  
  352.         new (somewhere) T;
  353.  
  354. and g++ won't accept it."
  355.  
  356.    Up until version 2.3.1, g++ accepted an alternate form of the
  357. placement syntax, for historical reasons; use
  358.  
  359.         new {somewhere} T;
  360.  
  361. if you are using g++-2.2.2 or older.
  362.  
  363.    As of 2.3.1, g++ finally fixed this, using the standard ARM syntax
  364. for "placement new".  A few remaining glitches were fixed in 2.3.2. 
  365. The only remaining problem is with declarators for pointers to
  366. functions;
  367.  
  368.      new (void (*)(int));  // confuses gcc 2.3.2
  369.      new (a) (void (*)(int)); // ditto
  370.  
  371.    These can be worked around with a typedef:
  372.  
  373.      typedef void (*fun)(int);
  374.      new fun;
  375.      new (a) fun;
  376.  
  377.  
  378. I think I have found a bug in g++.
  379. ==================================
  380.  
  381.    "I think I have found a bug in g++, but I'm not sure.  How do I
  382. know, and who should I tell?"
  383.  
  384.    First, see the excellent section on bugs and bug reports in the gcc
  385. manual (which is included in the gcc distribution).  As a short
  386. summary of that section: if the compiler gets a fatal signal, for any
  387. input, it's a bug.  Same thing for producing invalid assembly code.
  388.  
  389.    I will add some extra notes that are C++-specific, since the notes
  390. from gcc are generally C-specific.
  391.  
  392.    First, mail your bug report to "bug-g++@prep.ai.mit.edu".  You may
  393. also post to gnu.bug.g++, but it's better to use mail, particularly if
  394. you any doubt as to whether your news software generates correct reply
  395. addresses.  Don't mail C++ bugs to bug-gcc@prep.ai.mit.edu.
  396.  
  397.    If your bug involves libg++ rather than the compiler, mail to
  398. bug-libg++@prep.ai.mit.edu.  If you're not sure, you could send your
  399. bug to both lists.
  400.  
  401.    Second, if your program does one thing, and you think it should do
  402. something else, it is best to consult a good reference if in doubt. 
  403. The standard reference is "The Annotated C++ Reference Manual", by
  404. Ellis and Stroustrup (copyright 1990, ISBN #0-201-51459-1); the
  405. reference manual, without annotations, also appears in Stroustrup's
  406. "The C++ Programming Language, Second Edition" (copyright 1991, ISBN
  407. #0-201-53992-6).  Both are published by Addison-Wesley.
  408.  
  409.    Note that the behavior of (any version of) AT&T's "cfront" compiler
  410. is NOT the standard for the language.
  411.  
  412.  
  413. Porting programs from other compilers to g++
  414. ============================================
  415.  
  416.    "I have a program that runs on <some other C++ compiler>, and I want
  417. to get it running under g++.  Is there anything I should watch out
  418. for?"
  419.  
  420.    First, see the questions on placement new syntax and static data
  421. members.
  422.  
  423.    There are two other reasons why a program that worked under one
  424. compiler might fail under another: your program may depend on the
  425. order of evaluation of side effects in an expression, or it may depend
  426. on the lifetime of a temporary (you may be assuming that a temporary
  427. object "lives" longer than the standard guarantees).  As an example of
  428. the first:
  429.  
  430.        void func(int,int);
  431.  
  432.        int i = 3;     func(i++,i++);
  433.  
  434.    Novice programmers think that the increments will be evaluated in
  435. strict left-to-right order.  Neither C nor C++ guarantees this; the
  436. second increment might happen first, for example.  func might get 3,4,
  437. or it might get 4,3.
  438.  
  439.    The second problem often happens with classes like the libg++ String
  440. class.  Let's say I have
  441.  
  442.    String func1(); void func2(const char*);
  443.  
  444.    and I say
  445.  
  446.    func2(func1());
  447.  
  448.    because I know that class String has an "operator const char*".  So
  449. what really happens is
  450.  
  451.    func2(func1().convert());
  452.  
  453.    where I'm pretending I have a convert() method that is the same as
  454. the cast.  This is unsafe, because the temporary String object may be
  455. deleted after its last use (the call to the conversion function),
  456. leaving the pointer pointing to garbage, so by the time func2 is
  457. called, it gets an invalid argument.
  458.  
  459.    If you think this is ugly, you should know that the ANSI C++
  460. committee is STILL debating the lifetime-of-temporaries problem.
  461.  
  462.    For now, the safe way to write such code is to give the temporary a
  463. name, which forces it to live until the end of the scope of the name.
  464. For example:
  465.  
  466.        String& tmp = func1();     func2(tmp);
  467.  
  468.    Finally, like all compilers (but especially C++ compilers, it
  469. seems), g++ has bugs, and you may have tweaked one.
  470.  
  471.  
  472. Why does g++ mangle names differently from other C++ compilers?
  473. ===============================================================
  474.  
  475.    See the answer to the next question.
  476.  
  477.  
  478. Why can't g++ code link with code from other C++ compilers?
  479. ===========================================================
  480.  
  481.    "Why can't I link g++-compiled programs against libraries compiled
  482. by some other C++ compiler?"
  483.  
  484.    Some people think that, if only the FSF and Cygnus folks would stop
  485. being stubborn and mangle names the same way that, say, cfront does,
  486. then any g++-compiled program would link successfully against any
  487. cfront-compiled library and vice versa.  Name mangling is the least of
  488. the problems.  Compilers differ as to how objects are laid out, how
  489. multiple inheritance is implemented, how virtual function calls are
  490. handled, and so on, so if the name mangling were made the same, your
  491. programs would link against libraries provided from other compilers
  492. but then crash when run.  For this reason, the ARM *encourages*
  493. compiler writers to make their name mangling different from that of
  494. other compilers for the same platform.  Incompatible libraries are
  495. then detected at link time, rather than at run time.
  496.  
  497.  
  498. What documentation exists for g++ 2.x?
  499. ======================================
  500.  
  501.    Almost none.  The gcc manual describes the C front end, and also
  502. the back end, which is shared by the C++ compiler, but there is almost
  503. no documentation for the C++ front end.  There is a Unix-style manual
  504. entry, "g++.1", in the gcc-2.x distribution; this describes the extra
  505. command-line options that g++ supports, and the #pragma interface and
  506. #pragma implementation directives.
  507.  
  508.    A draft of a document describing the g++ internals appears in the
  509. 2.3.2 distribution (called g++int.texi); it is still incomplete.
  510.  
  511.    Work is proceeding on a user g++ document; with luck it will appear
  512. in the next release.
  513.  
  514.  
  515. What are the differences between g++ and the ARM specification of C++?
  516. ======================================================================
  517.  
  518.    The chief thing missing from g++ that is in the ARM is exceptions
  519. (the other major compilers do not have exceptions either).  There are
  520. bits and pieces of exception code present, but it is not presently
  521. usable.
  522.  
  523.    While, as of 2.3.1, the "placement new" syntax finally agrees with
  524. the ARM, there are still some problems with it.
  525.  
  526.    The template implementation is still new.  The implementation in
  527. 2.3.2 represents a considerable improvement over that of previous
  528. releases, however.  Still, it has many bugs.
  529.  
  530.    g++ does not implement a separate pass to instantiate template
  531. functions and classes at this point; for this reason, it will not
  532. work, for the most part, to declare your template functions in one
  533. file and define them in another.  The compiler will need to see the
  534. entire definition of the function, and will generate a static copy of
  535. the function in each file in which it is used.
  536.  
  537.    As with any beta-test compiler, there are bugs.  You can help
  538. improve the compiler by submitting detailed bug reports.
  539.  
  540.    [A full bug list would be very long indeed, so I won't put one here. 
  541. I may add a list of frequently-reported bugs and "non-bugs" like the
  542. static class members issue mentioned above].
  543.  
  544.  
  545. Will g++ compile InterViews?  The NIH class library?
  546. ====================================================
  547.  
  548.    The NIH class library uses a non-portable, compiler-dependent hack
  549. to initialize itself, which makes life difficult for g++ users.  It
  550. will not work without modification, and I don't know what modifications
  551. are required or whether anyone has done them successfully.
  552.  
  553.    Brendan Kehoe of Cygnus is working on getting NIHCL to build with
  554. g++.  He says, "The NIHCL release will hopefully contain patches to
  555. gcc 2.3 to let it build."
  556.  
  557.    [ From Stienar Bang <steinarb@idt.unit.no> ]
  558.  
  559.    The C++ compiler part of gcc-2.3 (when released) *should* be able to
  560. compile InterViews release 3.1 (when released) out of the box (no
  561. patches required on either side).
  562.  
  563.    [ Now that 2.3.1 is out, is this true? ]
  564.  
  565.  
  566. Debugging on SVR4 systems
  567. =========================
  568.  
  569.    "When I use the -g flag on C++ code on a System V Release 4 system,
  570. I get lots of undefined symbols at link time.  Why?  Help!"
  571.  
  572.    [From Ron Guilmette:] The changes needed to get the g++ front-end
  573. to generate proper DWARF style debugging information for System V
  574. Release 4 are not yet completed, nor will they be until g++ version
  575. 2.4 (at the earliest).
  576.  
  577.    There is nothing that you (as an end-user) can do to correct this
  578. problem.  (It is actually *many* problems, and they are all very
  579. complex.)  Until the g++ maintainers have time to fix this, you should
  580. simply *avoid* using the -g option when using g++ on SVR4.
  581.  
  582.  
  583. What are the rules for shipping code built with g++ and libg++?
  584. ***************************************************************
  585.  
  586.    "Is it is possible to distribute programs for profit that are
  587. created with g++ and use the g++ libraries?"
  588.  
  589.    I am not a lawyer, and this is not legal advice.  In any case, I
  590. have little interest in telling people how to violate the spirit of the
  591. Gnu licenses without violating the letter.  This section tells you how
  592. to comply with the intention of the Gnu licenses as best I understand
  593. them.
  594.  
  595.    The FSF has no objection to your making money.  Its only interest
  596. is that source code to their programs, and libraries, and to modified
  597. versions of their programs and libraries, is always available.
  598.  
  599.    The short answer is that you do not need to release the source to
  600. your program, but you can't just ship a stripped executable either.
  601.  
  602.    Compiling your code with a Gnu compiler does not affect its
  603. copyright; it is still yours.  However, in order to ship code that
  604. links in a Gnu library such as libg++ there are certain rules you must
  605. follow.  The rules are described in the file COPYING.LIB that
  606. accompanies gcc distributions; it is also included in the libg++
  607. distribution.  See that file for the exact rules.  The agreement is
  608. called the Library Gnu Public License or LGPL.  It is much "looser"
  609. than the Gnu Public License, or GPL, that covers must Gnu programs.
  610.  
  611.    Here's the deal: let's say that you use some version of libg++,
  612. completely unchanged, in your software, and you want to ship only a
  613. binary form of your code.  You can do this, but there are several
  614. special requirements.  If you want to use libg++ but ship only object
  615. code for your code, you have to ship source for libg++ (or ensure
  616. somehow that your customer already has the source for the exact
  617. version you are using), and ship your application in linkable form. 
  618. You cannot forbid your customer from reverse-engineering or extending
  619. your program by exploiting its linkable form.
  620.  
  621.    Furthermore, if you modify libg++ itself, you must provide source
  622. for your modifications (making a derived class does not count as
  623. modifying the library -- that is "a work that uses the library").
  624.  
  625.  
  626. --
  627. Joe Buck    jbuck@ohm.berkeley.edu
  628.